<script type="text/javascript">
	function insert(file)
	{
		$("#<?php echo $rt_tag?>", top.document).val(file);
                $("#<?php echo $rt_tag?>", top.document).change();
		parent.$.fn.colorbox.close();
	}
</script>
<div class="media-upload-header">
    <ul id="menu">
        <li><a href="<?php echo base_url()?>index.php/filemanager/index_new/<?php echo $dir_folder;?>/<?php echo $rt_tag?>" <?if($current_tab=='index'){echo ' class="current"';}?>>
            <?php echo lang('library');?>
            </a></li>
        <li><a href="<?php echo base_url()?>index.php/filemanager/upload_new/<?php echo $dir_folder;?>/<?php echo $rt_tag?>" <?if($current_tab=='upload'){echo ' class="current"';}?>>
            <?php echo lang('upload_file');?>
            </a></li>
    </ul>
</div>
<div class="form_upload">
    <div align="center" style="padding-top: 20px;">
        <?php echo form_open_multipart('filemanager/upload_new/'.$dir_folder.'/'.$rt_tag); ?>
        <table class="form">
            <tr>
                <td class="label"><?php echo lang('image_name');?></td>
                <td><input class="w300" type="text" name="lb_title" value=""/></td>
            </tr>
             <tr>
                <td class="label"><?php echo lang('image_description');?></td>
                <td><textarea class="w300" name="description"></textarea></td>
            </tr>
            <tr>
                <td class="label"><?php echo lang('choose_file_upload');?></td>
                <td>
                    <input  type="file" name="filedata">
                    <input type="hidden" name="id" value="1">
                    <input class="button" type="submit" name="upload" value="Upload">
                </td>
            </tr>
        </table>
        <?php  echo form_close(); ?>
    </div>
    <?php if(isset($file_name)&&isset($str_dir))
	{
    	//$img = explode('/',$file); 
    ?>
    <table class="site">
        <tr>
            <td><a id="closelink" href="#" onclick="insert('<?php echo $file_name?>');"><img src="<?php echo base_url_site().$str_dir.'/'.$file_name?>" height="50" alt=""></a></td>
            <td style="width: 150px"><a id="closelink" href="#" onclick="insert('<?php echo $file_name?>');"><b><?php echo lang('choose_file');?></b></a></td>
        </tr>
    </table>
    <?php }?>
</div>
